#ifndef DOWNLOADTHREAD_H
#define DOWNLOADTHREAD_H

#include <QObject>
#include <QSerialPort>
#include <QByteArray>
#include <QMutex>

class DownloadThread : public QObject
{
    Q_OBJECT
public:
    DownloadThread(quint8 *StFlag,QMutex *Mutex);

private:
    QSerialPort *comx;

    quint8 *StopFlag;
    quint8 RecvPack(int timeout);
    QMutex *mutex;

public slots:
    void OpenSeriaPort(QString PortName);
    void DownLoad_Handler(QString FilePath);

signals:
    void SeriaPortOff(void);
    void SeriaPortON(void);
    void DownLoad_IsSuccess(int reply);
    void File_NotExist(void);
    void File_OpenError(void);
    void SendingProgress(int value);
};

#endif // DOWNLOADTHREAD_H
